import { createApp, h } from 'vue'
import './style.css'
import Antd from 'ant-design-vue'
import App from './App.vue'
import 'ant-design-vue/dist/antd.css'

import { createPinia } from 'pinia'

import { router } from '@/router/index'

import '@/utils/auth.js'

import auth from '@/directives/auth'
// import { useSystemStore }  from './store/systemStore.js'
import '@/mock/index.js'
// import axios from 'axios'
// //统一前缀
// axios.defaults.baseURL = 'http://localhost:8080/api/'
// axios.interceptors.request.use(config => {
//   // 为请求头添加x-access-token字段为服务端返回的token
//   config.headers['token'] =useSystemStore().token;
//   // return config是固定用法 必须有返回值
//   return config
// })

import {
  PieChartOutlined,
  MenuUnfoldOutlined,
  MenuFoldOutlined,
  UserOutlined,
  PayCircleOutlined,
  MehOutlined
} from '@ant-design/icons-vue'

const app = createApp(App)
  .use(Antd)
  .use(router)
  .use(auth)
  .use(createPinia())

app.component('PieChartOutlined', PieChartOutlined)
app.component('MenuUnfoldOutlined', MenuUnfoldOutlined)
app.component('MenuFoldOutlined', MenuFoldOutlined)
app.component('UserOutlined', UserOutlined)
app.component('PayCircleOutlined', PayCircleOutlined)
app.component('MehOutlined', MehOutlined)

app.mount('#app')
